<%--
  Created by IntelliJ IDEA.
  User: kuibu
  Date: 16/2/25
  Time: 下午9:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>登陆丨跬步</title>
    <link rel="stylesheet" href="http://www.kuibutech.com/kuibuversion1/css/style.css">
    <link type="image/x-icon" rel="shortcut icon" href="http://img.kuibutech.com/kbApp_fixedImage/favicon.ico"/>
    <script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
    <link rel="stylesheet" type="text/css" href="http://www.kuibutech.com/kuibuversion1/css/sweetalert.css">
    <script src="http://www.kuibutech.com/kuibuversion1/js/sweetalert.min.js"></script>
    <script>
        function getInv() {
            var tel = document.getElementById("telnum").value;
            if (tel == "") {
                swal({
                    title: "",
                    text: "<span style=\"color:red;font-size: 20px\">请输入手机号<span>",
                    html: true,
                    allowOutsideClick: true,
                    showConfirmButton: true
                });
            }
            $.get("/kuibuversion1/user/htmlGetInviteCode/" + tel, {}, function (data) {
                if (data.inviteCode == "null") {
                    swal({
                        title: "查询失败",
                        text: "<span style=\"color:red;font-size: 20px\">未查询到结果<span>",
                        html: true,
                        allowOutsideClick: true,
                        showConfirmButton: true
                    });
                } else {
                    swal({
                        title: "查询成功",
                        text: "您的邀请码为：<span style=\"color:red;font-size: 20px\">" + data.inviteCode + "</span><br/>" + "您已经邀请的好友数为：<span style=\"color:red;font-size: 20px\">" + data.inviteFirendsNumber + "</span>",
                        html: true,
                        allowOutsideClick: true,
                        showConfirmButton: true
                    });
                }
            });
        }

        function login() {
            var tel = document.getElementById("telnum").value;
            var psd = document.getElementById("telnum").value;
            var form = document.getElementById("loginForm");
            if (tel == "") {
                swal({
                    title: "",
                    text: "<span style=\"color:red;font-size: 20px\">请查询手机号是否输入正确<span>",
                    html: true,
                    allowOutsideClick: true,
                    showConfirmButton: true
                });
                return false;
            }
            form.setAttribute("action", "/kuibuversion1/user/htmlLogin/" + tel + "/" + psd)
            form.submit();
        }
    </script>
</head>

<!--<body style="background-image: url(./loginBg.jpg);background-repeat:no-repeat;background-attachment:fixed;background-position:center center">-->
<body style="overflow: hidden">
<div style="position: absolute;width: 100%;">
    <div class="login-container">
        <h1>跬步</h1>

        <div class="connect">
            <p>走好大学每一步</p>
        </div>

        <form action="/kuibuversion1/version1_3/user/login" method="post" id="loginForm">
            <div>
                <input type="text" id="telnum" name="username" class="username" placeholder="手机号" autocomplete="off"/>
            </div>
            <div>
                <input type="password" id="password" name="password" class="password" placeholder="密码"
                       oncontextmenu="return false" onpaste="return false"/>
            </div>
            <button id="loginbtn" type="button" onclick="javascript:login()">登 陆</button>
        </form>

        <a href="/kuibuversion1/kuibu/register">
            <button type="button" class="register-tis">还没有账号？</button>
        </a>
        <div style="width:305px;margin:25px auto 0 auto;text-align:right;font-family:Microsoft YaHei "
             onclick="javascript:getInv()">我的邀请码-->
        </div>
    </div>
</div>
<img src="http://kuibutech.oss-cn-shanghai.aliyuncs.com/kbApp_fixedImage/loginBgPic.jpg">
</body>
</html>
